package com.hckj.medical.utils;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 获取异常
 */
@ControllerAdvice
public class MyException {
    @ExceptionHandler(Exception.class)
    @ResponseBody
    public R ex(Exception e){
        e.printStackTrace();
        return new R(Code.ALL_ERRO,"服务器出小差了，请稍后再试");
    }
}